<?php echo $this->Html->script(array('actions'),$options = array('allowCache'=>false,'safe'=>false,'inline'=>false));?>
<?php echo $this->Html->css(array('carts.view','form','actions'),null,array('inline'=>false));?>

<div class="content">
	<div class="left-column">
		<div class="box corners"><?php echo $this->Categories->categories(); ?></div>
		<div class="clr"></div>	
	</div>
	
	<div class="right-column">
	
		<div class="items view box corners">
			<h2><?php echo __('Koszyk',true)?></h2>
			<?php if(isset($items_order) && is_array($items_order) && !empty($items_order)){?>
			<?php echo $this->Form->create('Cart',array('url'=>array('plugin'=>false,'controller'=>$this->params['controller'],'action'=>'koszyk_zamow')));?>
			<table class="display" cellpadding="10" cellspacing="10">
			<tr>
				<td><?php echo __('Numer',true)?></td>
				<td><?php echo __('Zdjęcie',true)?></td>
				<td><?php echo __('Ilosć odbitek',true)?></td>
				<td><?php echo __('Format odbitek',true)?></td>
				<td><?php echo __('Rodzaj papieru',true)?></td>
				<td><?php echo __('Usuń z koszyka',true)?></td>
			</tr>
			
			<?php 

			foreach ($items_order as $k => $item){?>
			<tr>
				<td>
					<?php echo $this->Form->hidden('Cart.'.$item['Cart']['id'].'.numer',array('value'=>$item['Cart']['numer'],'label'=>false))?>
					<?php echo $this->Form->hidden('Cart.'.$item['Cart']['id'].'.url',array('value'=>$this->Html->url(array('action' => 'view', $item['Cart']['id']), true),'label'=>false))?>
					<?php echo $this->Form->hidden('Cart.'.$item['Cart']['id'].'.image',array('value'=> substr($this->Html->url('/',true),0,-1).$fileUpload->image($item['Upload']['name'],array('autoResize'=>true,'width'=>70,'imagePathOnly'=>true)),'label'=>false))?>		
					<?php echo $item['Cart']['numer']?>
				</td>
				<td>
					<div class="image-icons-list">			
						<?php echo $this->Html->link($fileUpload->image($item['Upload']['name'],array('autoResize'=>true,'width'=>70,'imagePathOnly'=>false,'onContextMenu'=>"alert('all pictures are copyrighted and not for to be used without permission'); return false;"))
							, array('action' => 'view', $item['Cart']['id'],Inflector::slug($item['Cart']['name'],'-')),array('escape'=>false)); ?>&nbsp;
						<div class="clr"></div>	
					</div>
				</td>
				<td>
					<?php echo $this->Form->input('Cart.'.$item['Cart']['id'].'.kopie',array('options'=>$this->Carts->kopie(),'selected'=>1,'label'=>false))?>
				</td>
				<td>
					<?php echo $this->Form->input('Cart.'.$item['Cart']['id'].'.format',array('options'=>$this->Carts->format(),'selected'=>'10x15','label'=>false))?>
				</td>
				<td>
					<?php echo $this->Form->input('Cart.'.$item['Cart']['id'].'.papier',array('options'=>array('blyszczacy'=>__('Błyszczce',true),'matowe'=>__('Matowe',true)),'selected'=>'10x15','label'=>false))?>
				</td>				
				<td>
					<?php echo $this->Html->link(__('usuń',true),array('action'=>'koszyk_usun',$item['Cart']['id']),array('class'=>'koszyk-links'))?>
				</td>
			</tr>
			<?php }?>
			<tr>
				<td colspan="5">
					
				</td>
				<td>
					<?php echo $this->Html->link(__('wyczysć koszyk',true),array('action'=>'koszyk_wyczysc'),array('class'=>'koszyk-links'));?>
				</td>
			</tr>
			</table>
			<?php echo $this->Form->end(__('Zamów',true)) ?>
			<?php }else{?>
				<?php __('Koszyk jest pusty')?>
			<?php } ?>
		</div>
		<div class="clr"></div>	
	</div>
	<div class="clr"></div>	
</div>
<div class="clr"></div>	